#ifndef SQLITETHREAD_H
#define SQLITETHREAD_H

#include <QTimer>
#include <QObject>
#include <QThread>
#include <QPoint>
#include <QDebug>
#include <QMetaType>
#include <QList>
#include <QMutex>

#include "sqlitetools.h"
#include "../config/constvariable.h"



class SQLiteThread : public QThread
{
  Q_OBJECT

signals:
  void mySignal(const QVector<Target_Info_Table>&,int); //自定义信号函数,msg参数可以省略

  void mySignalTargetName(const QVector<Target_Info_Table>&,int); //自定义信号函数,msg参数可以省略
public:
  explicit SQLiteThread(QString connectName,int num,QObject *parent = nullptr);
  ~SQLiteThread();

  void getGroupNumber(int msg);
  //getSearchDate
  //
  //    @Desc:查找获得数据库数据
  void getSearchDate();
public slots:

private:
  void run() override; //QThread的虚函数，线程处理函数,不能直接调用，通过start()间接调用

private:
  QVector<Target_Info_Table> curDate;

  QVector<Target_Info_Table> curDateName;

  QVector<int> vecRows;

  SQLiteTools *sqliteTools = nullptr;

  QString dbConnect;
  int groupNumber = 1;
  QList<int> m_list;

  int s_index = -1;

  QMutex mutex;
};

#endif // SQLITETHREAD_H
